<template>
    <div style="flex-direction: column;" >
        <APPTabBar :tabItems="tabItems" @tabBarOnClick="tabBarOnClick"></APPTabBar>
    </div>
</template>

<script>

  import mixins from '../mixins'
  import APPTabBar from '../components/APPTabBar.vue'
   export default {
        components: { APPTabBar },
        mixins:[mixins],
        data: function () {
          return {

            tabItems: [
              {
                index: 0,
                title: '资讯',
                titleColor: '#000000',
                icon: '',
                image: 'http://121.42.150.64:8099/resource/img/info.png',
                selectedImage: 'http://121.42.150.64:8099/resource/img/info-on.png',
                src: '/dist/info/index.js',
                visibility: 'visible',
              },
              {
                index: 1,
                title: '继光生涯',
                titleColor: '#000000',
                icon: '',
                image: 'http://121.42.150.64:8099/resource/img/class.png',
                selectedImage: 'http://121.42.150.64:8099/resource/img/class-on.png',
                src: '/dist/classroom/explore-learning.js',
                visibility: 'hidden',
              },
              {
                index: 2,
                title: '成果展示',
                titleColor: '#000000',
                icon: '',
                image: 'http://121.42.150.64:8099/resource/img/community.png',
                selectedImage: 'http://121.42.150.64:8099/resource/img/community-on.png',
                src: '/dist/community/index.js',
                visibility: 'hidden',
              },
              {
                index: 3,
                title: '问卷调查',
                titleColor: '#000000',
                icon: '',
                image: 'http://121.42.150.64:8099/resource/img/investigate.png',
                selectedImage: 'http://121.42.150.64:8099/resource/img/investigate-on.png',
                src: '/dist/investigate/index.js',
                visibility: 'hidden',
              }
            ],
          }
        },
        created: function() {
           var baseURL ="http://192.168.1.4:8099";
           for(var i = 0; i < this.tabItems.length; i++) {
             var tabItem = this.tabItems[i];
             tabItem.src = baseURL + tabItem.src;
           }
        },
        methods: {
          tabBarOnClick: function (e) {
            console.log('tabBarOnClick', e.index)
          }
        }
  }

</script>